<html>
<head>
	<meta charset="UTF-8">
	<title>应用模型信息新增</title>
	<link id="easyuiTheme"  href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
	<link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
	<link href="../../static/css/esaas-easyui-add.css" rel="stylesheet" type="text/css"/>
	<script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
	<script src="../../static/easyui/jquery.cookie.js" type="text/javascript"></script>
	<script src="../../static/easyui/ui-theme.js" type="text/javascript"></script>
	<script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
	<script src="../../ffres/dict/all.js" type="text/javascript"></script>
	<a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<body class="easyui-layout">
	<form id="ff" method="post">
		<div class="esaas-info-title">服务基本信息</div>
		<table class="esaas-info-edit-table">
			<tr>
				<td width="25%" align="right">应用唯一标识：</td>
				<td width="75%"><input class="easyui-textbox" type="text" readonly
				   id="appId" name="appId" data-options="required:true"
				   style="width: 85%; height: 25px;">
				</input></td>
			</tr>
			<tr>
				<td width="25%" align="right">服务分类：</td>
				<td width="75%"><select class="easyui-combobox"
					id="appModelCatalog" name="appModelCatalog" readonly
					style="width: 100%; height: 25px;"
					data-options="required:false,editable:false,valueField:'enname',textField:'cnname',data:APP_MODEL_CATALOG">
				</select></td>
			</tr>
			<tr>
				<td width="25%" align="right">服务类型：</td>
				<td width="75%"><select class="easyui-combobox"
					id="appModelType" name="appModelType" readonly
					style="width: 85%; height: 25px;"
					data-options="required:true,editable:false,valueField:'enname',textField:'cnname',data:APP_MODEL_TYPE">
				</select></td>
			</tr>
			<!--<tr>
				<td width="25%" align="right">表模型代码：</td>
				<td width="75%"><input class="easyui-textbox" type="text" readonly
					id="tableModelCode" name="tableModelCode" data-options="required:true"
					style="width: 85%; height: 25px;">
					</input><a href="javascript:void(0)" class="easyui-linkbutton" disabled onclick="openSelectModelCodePage()">选择</a></td>
			</tr>
			<tr>
				<td width="25%" align="right">表模型名称：</td>
				<td width="75%"><input class="easyui-textbox" type="text" readonly
					id="tableModelName" name="tableModelName" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="25%" align="right">表模型ID：</td>
				<td width="75%"><input class="easyui-textbox" type="text" readonly
					id="tableModelId" name="tableModelId" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
			</tr>-->
			<tr>
				<td width="25%" align="right">目录包标识：</td>
				<td width="75%"><input class="easyui-textbox" type="text"
					id="packageId" name="packageId" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="25%" align="right">服务名：</td>
				<td width="75%"><input class="easyui-textbox" type="text"
					name="appModelCode" data-options="required:true"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="25%" align="right">服务描述：</td>
				<td width="75%"><input class="easyui-textbox" type="text"
					name="appModelName" data-options="required:true"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
		</table>
	</form>
	<div style="text-align: center; padding: 15px">
		<a href="javascript:void(0)" class="easyui-linkbutton"
			onclick="submitForm()">&nbsp;配置参数&nbsp;</a> <a
			href="javascript:void(0)" class="easyui-linkbutton"
			onclick="closeForm()">&nbsp;关&nbsp;闭&nbsp;</a>
	</div>
	<script>

		var appId = $.getUrlParam('appId');
		var packageCode = $.getUrlParam('packageCode');
		var projectId = $.getUrlParam('projectId');
		var appModelCatalog = $.getUrlParam('appModelCatalog');
		$(function() {
			$('#appModelCatalog').combobox('setValue', appModelCatalog);
			$('#packageId').textbox('setValue', projectId);
			$('#appModelType').combobox('setValue', 'A0101');
			$('#appId').textbox('setValue', appId);

		});

		function submitForm() {
			if (!$('#ff').form('validate'))
				return;
			var jsonData = $("#ff").serializeJson();
			$.restfulPostJson('../../api/app/model/info', jsonData, function(data) {
				// window.parent.JLEUtil.closewin();
				// window.parent.reloadList();
				var appModelId = data.rows;
				JLEUtil.createModalWin('修改服务', `IsvInoutInfoUpdate.html?appId=${appId}&appModelId=${appModelId}`);

			});
		};
		
		function closeForm() {
			window.parent.JLEUtil.closewin();
		}
		
		function setModelCodeValue(data) {
			$('#tableModelCode').textbox('setValue', data.objectCode);
			$('#tableModelName').textbox('setValue', data.objectName);
			$('#tableModelId').textbox('setValue', data.tableModelId);
		}
	</script>
</body>
</html>
